package main

import (
	"sensitives/controller/reset"
	"sensitives/controller/system"
	"sensitives/controller/ugc"
	"sensitives/service/conf"
	"sensitives/service/dic"

	"github.com/gin-gonic/gin"
)

func main() {
	go dic.Updatedic()
	// gin.SetMode(gin.ReleaseMode)
	router := gin.New()
	Rsystem := router.Group("system")
	{
		Rsystem.GET("list/:siteid", system.List)
		Rsystem.POST("article/:siteid", system.Article.Check)
		Rsystem.POST("audio/:siteid", system.Audio.Check)
		Rsystem.POST("ctmedia/:siteid", system.Ctmedia.Check)
		Rsystem.POST("ctanswer/:siteid", system.Ctanswer.Check)
		Rsystem.POST("gallery/:siteid", system.Gallery.Check)
		Rsystem.POST("link/:siteid", system.Link.Check)
		Rsystem.POST("live/:siteid", system.Live.Check)
		Rsystem.POST("political/:siteid", system.Political.Check)
		Rsystem.POST("mpush/:siteid", system.Pushmsg.Check)
		Rsystem.POST("signup/:siteid", system.Signup.Check)
		Rsystem.POST("special/:siteid", system.Special.Check)
		Rsystem.POST("video/:siteid", system.Video.Check)
		Rsystem.POST("vote/:siteid", system.Vote.Check)
		Rsystem.POST("wechatsend/:siteid", system.WechatSend.Check)
		Rsystem.POST("advertise/:siteid", system.Advertise.Check)
		//vms 系统
		Rsystem.POST("vmsincision/:siteid", system.Vms.Incision)
		Rsystem.POST("vmsrecord/:siteid", system.Vms.Record)

		Rsystem.POST("lottery/:siteid", system.Lottery.Check)
		// 移动采编
		Rsystem.POST("collect_article/:siteid", system.Collect.Article)
		Rsystem.POST("collect_gallery/:siteid", system.Collect.Gallery)
		Rsystem.POST("collect_attachment/:siteid", system.Collect.Attachment)
	}

	Usystem := router.Group("ugc")
	{
		Usystem.GET("list/:siteid", ugc.List)
		Usystem.POST("livecomment/:siteid", ugc.Live.Comment)
		Usystem.POST("livepost/:siteid", ugc.Live.Post)
		Usystem.POST("comment/:siteid", ugc.Comment.Check)
		Usystem.POST("member/:siteid", ugc.Member.Check)
		Usystem.POST("contribute/:siteid", ugc.Contribute.Check)
		Usystem.POST("ctmediafaq/:siteid", ugc.Ctmedia.Faq)
		Usystem.POST("signup/:siteid", ugc.Signup.Check)
		Usystem.POST("politics/:siteid", ugc.Politics.Check)
		Usystem.POST("report/:siteid", ugc.Report.Check)
	}
	// 提供及时刷新某个站点敏感词的接口
	router.GET("/site/:siteid", reset.Reload)
	router.Run(conf.GetHostPort())
}
